<?php
@session_start();
require_once("connect_db.php");
$sqlOr="select * from orders where std_id='".$_SESSION["id"]."' and order_status!='C'";
$queryOr=mysql_query($sqlOr);
$resultOr=mysql_fetch_array($queryOr);
$sqlMeet="select meet_datetime,DATE_ADD(meet_datetime,INTERVAL meet_hour HOUR) As meet_datetimeEnd from meeting,orders ";
$sqlMeet.="where  meeting.order_id=orders.order_id and meet_status='N' and teach_id='".$resultOr["teach_id"]."' and std_id!='".$_SESSION["id"]."'";
$queryMeet=mysql_query($sqlMeet);

$check="Y";
$input_date=$_GET["input_date"]." ".$_GET["time"].":00:00";
while($resultMeet=mysql_fetch_array($queryMeet)){
if($input_date>=$resultMeet["meet_datetime"]&&$input_date<=$resultMeet["meet_datetimeEnd"]){
$check="N";
break;
}
}
echo $check;
?>